onload = function(){
    let item = this.document.getElementById('item');
    let itemRawPostion = item.getBoundingClientRect()
    function move(x,y,time){
        let destination='';
        item.style.transform = `translate(${x}px,${y}px)`;
        item.style.transition = `all ${time}s`;
        let id = setInterval(function(){
            let newPostion = item.getBoundingClientRect()
            if(newPostion.x == x+itemRawPostion.x && newPostion.y == y+itemRawPostion.y){
                console.log('到达目标');
                clearInterval(id)
            }
        },10)


    };
    this.window.move = move;
    item.addEventListener('transitionend',function(){
        console.log('运动结束！')
    });


}